#include <iostream>
using namespace std;

int main()
{
	int n;
	while (cin >> n && n) {
		int max = 8, pos = 0;
		for (int k = 0; k < n; ++k) {
			int i, j;
			cin >> i >> j;
			if (i + j > max) {
				max = i + j;
				pos = k + 1;
			}
		}
		cout << pos  << endl;
	}
	return 0;
}
